-
-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subject prefix #3422
Subject prefix #3422
Conversation
src/main/java/org/dependencytrack/notification/publisher/SendMailPublisher.java
Outdated
Show resolved
Hide resolved
7ee2de5
to
172a374
Compare
Add Email Subject Prefix dynamic option to email sender, it will take value from Subject prefix input box added in Frontend. Follows the same variable convention. defaultPropertyValue will be [Dependency-Track] Signed-off-by: Andres Tito <[email protected]>
Add condition to clean value if User choose not to have a Subject Prefix Signed-off-by: Andres Tito <[email protected]>
The prefix is not really tied to the SMTP protocol. If other email delivery methods are added in the future, the prefix might still be valid to use, but should not be called smtpPrefix. Signed-off-by: Andres Tito <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @LaVibeX!
Looks like this broke |
b0e8b25
to
19b7e5b
Compare
Remove space on SendMailPublisher.java and add EMAIL_PREFIX Properties to SendMailPublisherTest.java Signed-off-by: Andres Tito <[email protected]>
Locally, I ran the tests after my commit and it finish without any errors. Could it be possible to run the test again @nscuro ?
|
Triggered another test run. |
it says that it implements #1823 |
You are right @girtsn, I reopened the issue. Thanks for pointing that out, much appreciated! |
Description
.subject("[Dependency-Track] " + notification.getTitle())
,.subject(smtpPrefix + " " + notification.getTitle() )
This modification would be available in
Administration>Configuration>Email
and
"[Dependency-Track]"
would be the first default value.If the User change the Subject Prefix, it will need to press Update button in order to save the changes.
Subject Prefix is not a required field so leaving the input box in blank is also an option.
This new feature helps to distinguish between several instances of Dependency-Track, e.g. prod and qual systems.
Default value: [Dependency-Track]
Modified Value: [Dependency-Track TEST ®]
Modified Value: " "
This PR depends on its corresponding PR in the frontend repository
DependencyTrack/frontend#720
Addressed Issue
This fixes #1823
Additional Details
Check if smtpPrefix is null in order to clean the value to " "
smtpPrefix = smtpPrefix == null ? " " : smtpPrefix;
This PR is supervised by @lukas-braune.
Checklist
Signed-off-by: Andres Tito [email protected]